/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Windows7
 */
public class SendandGetInfor {
    private InetSocketAddress address;
    private Socket socket;

    public SendandGetInfor(InetSocketAddress address) {
        this.address = address;
        this.socket = new Socket();
    }
    
    public ArrayList<taskGame> sendAndGet()
    {
        ArrayList<taskGame> result = new ArrayList<taskGame>();
        try 
        {    
            this.socket.connect(this.address);
            ObjectOutputStream out = new ObjectOutputStream(this.socket.getOutputStream());
            out.writeObject(result);
            this.socket.close();
            
        } catch (IOException ex) {
            
        }
        return result;
    }
}
